package com.inwk.valoepi.util;

import java.util.ArrayList;
import java.util.List;
import static com.inwk.valoepi.util.MiscUtils.readTextFileToList;

import com.inwk.valoepi.model.Product;

public class TestDataReader {
	private static String productCSVFileName = "\\src\\test\\resources\\products.csv";
	
	public static List<Product> getProductsList() {
		List<Product> lst = new ArrayList<Product>();
		List<String> lstCSV = readTextFileToList(productCSVFileName);
		for(int i = 1; i < lstCSV.size(); i++) {
			String[] tmp = lstCSV.get(i).split(";");
			lst.add(new Product().setName(tmp[0]).setId(tmp[1]).setQuantity(tmp[2]));
		}
		return lst;
	}
}
